package edu.towson.cosc490.incaseofemergency;

import java.util.ArrayList;
import java.util.Arrays;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class FloodInformation extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_flood_information);
		
		//create the list view
		ListView floodList;
		floodList = (ListView) findViewById(R.id.listView_FloodTips);
		
		//load the list of tips into the the listview
		String[] floodArr = getResources().getStringArray(R.array.flood_tips);
		ArrayList<String> floodArrList = new ArrayList<String>();
		floodArrList.addAll(Arrays.asList(floodArr));
		
		//create an adapter for the listview
		ArrayAdapter<String> floodListAdapter = new ArrayAdapter<String>(this, R.layout.row_flood_information, floodArrList);
		
		//set the array adapter as the listview's adapter
		floodList.setAdapter(floodListAdapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_flood_information, menu);
		return true;
	}

}
